package com.yc.Di.bean3_vlaue_spEL;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author zwei
 * @create 2024-07-31 18:35
 */
@Component
public class Person {
    @Value("#{T(java.lang.Math).random()*1000}")
    private int id;         //随机生成
    @Value("#{new String('hello').toUpperCase()}")
    private String words;

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", words='" + words + '\'' +
                '}';
    }
}
